<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>$Rep - Macros</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../styles/styles.css">
</head>

<body>

<h1>$Rep</h1>
<div class="navbar">
<a href="../../index.html">main</a> |
<a href="../index.html">Macros</a> |
<a href="index.html">Macro-language</a> |
<a href="cmds.html">Macro-commands</a>
</div>

<div class=shortdescr>
The <dfn>$Rep</dfn> loop macro-command executes the Sequence of the macro-commands Expr number of times.
</div>

<pre class=syntax>
<dfn>$Rep</dfn> <dfn>(</dfn><em>Expr</em><dfn>)</dfn> <em>Sequence</em> <dfn>$End</dfn>
</pre>

<h3>Elements</h3>

<div class=descr>
<div class=dfn>Expr</div>
<div class=dfndescr>Expression, evaluated once on loop initialization.</div>

<div class=dfn>Sequence</div>
<div class=dfndescr>Sequence to be executed <dfn>Expr</dfn> times.</div>
</div>

<h3>Notes</h3>
<div class=descr>
<ol>
<li>It is impossible to use macro-language elements while <a href="../macrokey/record.html">recording</a>
  a macro in a usual way. Macro-language elements can be added to the sequence only by editing
  the registry manually or by using special applications or FAR plugins.</li>
</ol>
</div>

<h3>Example</h3>
<div class=descr>
<pre class=code>REGEDIT4

;exit FAR Manager

[HKEY_CURRENT_USER\Software\Far\KeyMacros\Common\AltX]
"Sequence"="$If (Editor && (Editor.State & 0x8)) F2 $End
$Rep (2) $If (!Shell) Esc $End $End F10"
"DisableOutput"=dword:00000001
</pre>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="../examples.html">Examples</a>, <a href="while.html">$While</a>
</div>


</body>

</html>
